package cn.desk.message.service.impl;

import cn.desk.commons.entity.PageMode;
import cn.desk.commons.service.IBaseService;
import cn.desk.commons.service.impl.BaseServiceImpl;
import cn.desk.commons.util.QueryCondition;
import cn.desk.message.entity.Message;

public class MessageServiceImpl<T extends Message> extends BaseServiceImpl<T>
		implements IBaseService<T> {
	
	public PageMode<T> listPage(
			PageMode<T> page, T t) {
		QueryCondition condition=new QueryCondition();
		if(t.getId()!=null&&!t.getId().equals("")){
			condition.andEq("id", t.getId());
		}
		if(t.getMessage()!=null&&!t.getMessage().equals("")){
			condition.andLike("message", t.getMessage(),QueryCondition.MATCH_TYPE_ANY);
		}
		condition.desc("id");
		return baseDao.listPage(page, Message.class, condition);
	}
	
}
